home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / wedl20.zip / WEDLE.PAS < prev   
Pascal/Delphi Source File  |  1991-05-01  |  13KB  |  325 lines

  1.  
  2. {-----------------------------------------------------------------------------}
  3. {                                                                             }
  4. {           WEDL (tm) - Windows Enhanced Dialog Library                       }
  5. {           Copyright (c) 1991-1992, Nemisoft, Inc.                           }
  6. {           All Rights Reserved                                               }
  7. {           Module:  WEDLE.PAS                                                }
  8. {                                                                             }
  9. {-----------------------------------------------------------------------------}
  10.  
  11. unit WEDL;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. const
  18.  
  19.     FMF_NONE     : LongInt = 0;
  20.     FMF_OVERTYPE : LongInt = 1;
  21.     FMF_UPDATE   : LongInt = 2;
  22.     FMF_VKEYPRES : LongInt = 4;
  23.     FMF_VLEAVFLD : LongInt = 8;
  24.     FMF_NOSELECT : LongInt = 16;
  25.  
  26.     FDF_NONE     : LongInt = 0;
  27.     FDF_COMPLETE : LongInt = 1;
  28.     FDF_NOTBLANK : LongInt = 2;
  29.     FDF_NOTZERO  : LongInt = 4;
  30.     FDF_NOTEDIT  : LongInt = 8;
  31.     FDF_MUSTEDIT : LongInt = 16;
  32.     FDF_UPDATE   : LongInt = 32;
  33.     FDF_NOSELECT : LongInt = 64;
  34.     FDF_SPCFILL  : LongInt = 128;
  35.     FDF_ZEROFILL : LongInt = 256;
  36.     FDF_BLNKZERO : LongInt = 512;
  37.     FDF_BLNKNEZ  : LongInt = 1024;
  38.     FDF_PHYSICAL : LongInt = 2048;
  39.     FDF_UPPER    : LongInt = 4096;
  40.     FDF_LOWER    : LongInt = 8192;
  41.     FDF_PROPER   : LongInt = 16384;
  42.     FDF_NUMERIC  : LongInt = 32768;
  43.     FDF_CALCNUM  : LongInt = 65536;
  44.     FDF_VKEYPRES : LongInt = 131072;
  45.     FDF_VLEAVFLD : LongInt = 262144;
  46.     FDF_COMBO    : LongInt = 524288;
  47.  
  48.     ELC_BLANK    : LongInt = 1;
  49.     ELC_ZERO     : LongInt = 2;
  50.     ELC_EDITED   : LongInt = 3;
  51.     ELC_CHECKED  : LongInt = 4;
  52.  
  53.     FDT_NULL     = 0;
  54.     FDT_STRING   = 1;
  55.     FDT_SHORT    = 2;
  56.     FDT_USHORT   = 3;
  57.     FDT_INTEGER  = 4;
  58.     FDT_UNSIGNED = 5;
  59.     FDT_LONG     = 6;
  60.     FDT_ULONG    = 7;
  61.     FDT_FLOAT    = 8;
  62.     FDT_DOUBLE   = 9;
  63.  
  64.     BTF_NONE     : LongInt = 0;
  65.     BTF_CHECKED  : LongInt = 1;
  66.     BTF_GRAYED   : LongInt = 2;
  67.     BTF_UPDATE   : LongInt = 4;
  68.     BTF_GENERIC  : LongInt = 8;
  69.     BTF_IDOK     : LongInt = 16;
  70.     BTF_IDCANCEL : LongInt = 32;
  71.  
  72.     KSM_INSERT   = 0;
  73.     KSM_CAPSLOCK = 1;
  74.     KSM_NUMLOCK  = 2;
  75.  
  76.     ERV_BLANK    = 27701;
  77.     ERV_INCOMPL  = 27702;
  78.     ERV_INVCHAR  = 27703;
  79.     ERV_NOTEDIT  = 27704;
  80.     ERV_UNEDITED = 27705;
  81.     ERV_ZERO     = 27706;
  82.  
  83.     ERE_KEYPRESS = 1;
  84.     ERE_LEAVEFLD = 2;
  85.     ERE_SELECTOK = 3;
  86.  
  87. type
  88.  
  89.     HFORM        = THandle;
  90.     HFIELD       = THandle;
  91.     HBUTTON      = THandle;
  92.  
  93.     PVALFUNC     = TFarProc;
  94.     PERRFUNC     = TFarProc;
  95.  
  96.     FIELD = record
  97.         features          : LongInt;
  98.         help_context      : LongInt;
  99.         picture_string    : PStr;
  100.         pdata             : LPVoid;
  101.         pvalid_func       : PVALFUNC;
  102.         hcombo            : HWnd;
  103.         hwnd              : HWnd;
  104.         hfield            : HFIELD;
  105.         hnext_field       : HFIELD;
  106.         ctrl_id           : Integer;
  107.         data_type         : Integer;
  108.         decimal_position  : Integer;
  109.         error_value       : Integer;
  110.         logical_size      : Integer;
  111.         physical_size     : Integer;
  112.         has_changed       : Bool;
  113.     end;
  114.  
  115.     PFIELD  = ^FIELD;
  116.     LPFIELD = PFIELD;
  117.  
  118.     FIELD_POS = record
  119.         ppicture_str_pos  : PStr;
  120.         selection         : LongInt;
  121.         logical_position  : Integer;
  122.         physical_position : Integer;
  123.         val_char_occ      : Integer;
  124.         to_right_of_dec   : Bool;
  125.         validation_char   : Char;
  126.     end;
  127.  
  128.     PFIELD_POS  = ^FIELD_POS;
  129.     LPFIELD_POS = PFIELD_POS;
  130.  
  131.     FORM = record
  132.         features          : LongInt;
  133.         perror_func       : PERRFUNC;
  134.         pdialog_proc      : TFarProc;
  135.         help_context      : LongInt;
  136.         capslock_offmsg   : PStr;
  137.         capslock_onmsg    : PStr;
  138.         help_file_name    : PStr;
  139.         insert_offmsg     : PStr;
  140.         insert_onmsg      : PStr;
  141.         numlock_offmsg    : PStr;
  142.         numlock_onmsg     : PStr;
  143.         undo_selection    : LongInt;
  144.         hhead_elink       : THandle;
  145.         hproc_array       : THandle;
  146.         hundo_buffer1     : THandle;
  147.         hundo_buffer2     : THandle;
  148.         hdlg              : HWnd;
  149.         hform             : HFORM;
  150.         hnext_form        : HFORM;
  151.         hcurr_field       : HFIELD;
  152.         herror_field      : HFIELD;
  153.         hhead_field       : HFIELD;
  154.         hhead_button      : HBUTTON;
  155.         cancel_id         : Integer;
  156.         capslock_id       : Integer;
  157.         error_event       : Integer;
  158.         error_position    : Integer;
  159.         error_value       : Integer;
  160.         insert_id         : Integer;
  161.         numlock_id        : Integer;
  162.         num_controls      : Integer;
  163.         ok_id             : Integer;
  164.         undo_level        : Integer;
  165.         edit_key_pressed  : Bool;
  166.         help_invoked      : Bool;
  167.         insert_mode       : Bool;
  168.         in_error_handler  : Bool;
  169.         just_passed_dec   : Bool;
  170.         pressed_cancel    : Bool;
  171.     end;
  172.  
  173.     PFORM  = ^FORM;
  174.     LPFORM = PFORM;
  175.  
  176.     BUTTON = record
  177.         features          : LongInt;
  178.         help_context      : LongInt;
  179.         pdata             : PInteger;
  180.         hwnd              : HWnd;
  181.         hbutton           : HBUTTON;
  182.         hnext_button      : HBUTTON;
  183.         ctrl_id           : Integer;
  184.         group_id          : Integer;
  185.         off_value         : Integer;
  186.         on_value          : Integer;
  187.         has_changed       : Bool;
  188.     end;
  189.  
  190.     PBUTTON  = ^BUTTON;
  191.     LPBUTTON = PBUTTON;
  192.  
  193. function button_define( form: HFORM; ctrl_id: Integer; pdata: PInteger;
  194.                         group_id, on_value, off_value: Integer;
  195.                         features, help_context: LongInt ): HBUTTON;
  196. function button_get_check( button: HBUTTON ): Integer;
  197. function button_get_from_ctrl_id( form: HFORM; ctrl_id: Integer ): HBUTTON;
  198. function button_get_from_group( form: HFORM; group_id: Integer): HBUTTON;
  199. function button_get_from_hwnd( form: HFORM; Wnd: HWnd ): HBUTTON;
  200. function button_get_hwnd( button: HBUTTON ): HWnd;
  201. function button_has_changed( button: HBUTTON ): Bool;
  202. function button_lock( button: HBUTTON ): LPBUTTON;
  203. function button_set_check( button: HBUTTON; state: Integer ): Integer;
  204. procedure button_unlock( button: HBUTTON );
  205.  
  206. function char_is_printable( ch: Integer ): Bool;
  207. function char_to_lower( ch: Integer ): Integer;
  208. function char_to_upper( ch: Integer ): Integer;
  209.  
  210. function field_data_to_log( field: HFIELD; pbuf: PStr; pdata: LPVoid;
  211.                             data_type: Integer ): Integer;
  212. function field_define( form: HFORM; ctrl_id: Integer; pdata: LPVoid;
  213.                        data_type: Integer; picture_string: PStr;
  214.                        features: LongInt; pvalid_func: PVALFUNC;
  215.                        error_value: Integer; help_context: LongInt ): HFIELD;
  216. function field_get_character( field: HFIELD; position: Integer;
  217.                               physical: Bool ): Integer;
  218. function field_get_from_ctrl_id( form: HFORM; ctrl_id: Integer ): HFIELD;
  219. function field_get_from_hwnd( form: HFORM; Wnd: HWnd ): HFIELD;
  220. function field_get_hwnd( field: HFIELD ): HWND;
  221. function field_get_pos_info( field: HFIELD; logical_position: Integer;
  222.                              pfpos: LPFIELD_POS ): Integer;
  223. function field_get_position( field: HFIELD; pfpos: LPFIELD_POS ): Integer;
  224. function field_get_text( field: HFIELD; pbuf: PStr; physical: Bool ): Integer;
  225. function field_has_changed( field: HFIELD ): Bool;
  226. function field_lock( field: HFIELD ): LPFIELD;
  227. function field_log_to_data( field: HFIELD; pbuf: PStr; pdata: LPVoid;
  228.                             data_type: Integer ): Integer;
  229. function field_log_to_phys( field: HFIELD; pbuf: PStr ): Integer;
  230. function field_phys_to_log( field: HFIELD; pbuf: PStr ): Integer;
  231. function field_set_text( field: HFIELD; pbuf: PStr; physical: Bool ): Integer;
  232. procedure field_unlock( field: HFIELD );
  233.  
  234. function form_begin( hDlg: HWnd; features: LongInt; perror_func: PERRFUNC ): HFORM;
  235. function form_cancel( form: HFORM ): Integer;
  236. function form_end( form: HFORM ): Integer;
  237. function form_exists( form: HFORM ): Bool;
  238. function form_get_from_hdlg( hDlg: HWnd ): HFORM;
  239. function form_get_hdlg( form: HFORM ): HWnd;
  240. function form_has_changed( form: HFORM ): Bool;
  241. function form_in_error_cond( form: HFORM ): Bool;
  242. function form_is_cancelled( form: HFORM ): Bool;
  243. function form_load( form: HFORM ): Integer;
  244. function form_lock( form: HFORM ): LPFORM;
  245. function form_ok( form: HFORM ): Integer;
  246. function form_save( form: HFORM ): Integer;
  247. function form_set_enable_link( form: HFORM; hcontrol: THandle;
  248.                                condition: LongInt; ctrl_id: Integer;
  249.                                enable: Bool ) : Integer;
  250. function form_set_help( form: HFORM; help_file_name: PStr;
  251.                         help_context: LongInt ): Integer;
  252. procedure form_unlock( form: HFORM );
  253. function form_validate( form: HFORM ): HFIELD;
  254.  
  255. function generic_define( form: HFORM; ctrl_id: Integer;
  256.                          help_context: LongInt ): THandle;
  257.  
  258. function keystat_define( form: HFORM; ctrl_id, which: Integer;
  259.                          onmsg, offmsg: PStr ): Integer;
  260.  
  261. function str_delete_char( str: PStr; ch: Integer ): Integer;
  262. procedure str_insert_char( str: PStr; ch, offs: Integer );
  263. function str_is_blank( str: PStr ): Bool;
  264. function str_is_value_zero( str: PStr ): Bool;
  265. procedure str_trim_spaces( str: PStr );
  266.  
  267. implementation
  268.  
  269. function button_define;             external 'WEDL2E' index 7;
  270. function button_get_check;          external 'WEDL2E' index 8;
  271. function button_get_from_ctrl_id;   external 'WEDL2E' index 9;
  272. function button_get_from_group;     external 'WEDL2E' index 10;
  273. function button_get_from_hwnd;      external 'WEDL2E' index 11;
  274. function button_get_hwnd;           external 'WEDL2E' index 12;
  275. function button_has_changed;        external 'WEDL2E' index 13;
  276. function button_lock;               external 'WEDL2E' index 14;
  277. function button_set_check;          external 'WEDL2E' index 15;
  278. procedure button_unlock;            external 'WEDL2E' index 16;
  279. function char_is_printable;         external 'WEDL2E' index 17;
  280. function char_to_lower;             external 'WEDL2E' index 18;
  281. function char_to_upper;             external 'WEDL2E' index 19;
  282. function field_data_to_log;         external 'WEDL2E' index 20;
  283. function field_define;              external 'WEDL2E' index 21;
  284. function field_get_character;       external 'WEDL2E' index 22;
  285. function field_get_from_ctrl_id;    external 'WEDL2E' index 23;
  286. function field_get_from_hwnd;       external 'WEDL2E' index 24;
  287. function field_get_hwnd;            external 'WEDL2E' index 25;
  288. function field_get_pos_info;        external 'WEDL2E' index 26;
  289. function field_get_position;        external 'WEDL2E' index 27;
  290. function field_get_text;            external 'WEDL2E' index 28;
  291. function field_has_changed;         external 'WEDL2E' index 29;
  292. function field_lock;                external 'WEDL2E' index 30;
  293. function field_log_to_data;         external 'WEDL2E' index 31;
  294. function field_log_to_phys;         external 'WEDL2E' index 32;
  295. function field_phys_to_log;         external 'WEDL2E' index 33;
  296. function field_set_text;            external 'WEDL2E' index 34;
  297. procedure field_unlock;             external 'WEDL2E' index 35;
  298. function form_begin;                external 'WEDL2E' index 36;
  299. function form_cancel;               external 'WEDL2E' index 37;
  300. function form_end;                  external 'WEDL2E' index 38;
  301. function form_exists;               external 'WEDL2E' index 39;
  302. function form_get_from_hdlg;        external 'WEDL2E' index 40;
  303. function form_get_hdlg;             external 'WEDL2E' index 41;
  304. function form_has_changed;          external 'WEDL2E' index 42;
  305. function form_in_error_cond;        external 'WEDL2E' index 43;
  306. function form_is_cancelled;         external 'WEDL2E' index 44;
  307. function form_load;                 external 'WEDL2E' index 45;
  308. function form_lock;                 external 'WEDL2E' index 46;
  309. function form_ok;                   external 'WEDL2E' index 47;
  310. function form_save;                 external 'WEDL2E' index 48;
  311. function form_set_enable_link;      external 'WEDL2E' index 49;
  312. function form_set_help;             external 'WEDL2E' index 50;
  313. procedure form_unlock;              external 'WEDL2E' index 51;
  314. function form_validate;             external 'WEDL2E' index 52;
  315. function generic_define;            external 'WEDL2E' index 53;
  316. function keystat_define;            external 'WEDL2E' index 54;
  317. function str_delete_char;           external 'WEDL2E' index 55;
  318. procedure str_insert_char;          external 'WEDL2E' index 56;
  319. function str_is_blank;              external 'WEDL2E' index 57;
  320. function str_is_value_zero;         external 'WEDL2E' index 58;
  321. procedure str_trim_spaces;          external 'WEDL2E' index 59;
  322.  
  323. end.
  324.  
  325.